<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>盛世机电</title>
    <link href="/common/css/common-ui.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="/css/backstageManage/projectInfo.css" />
    <script>
        if(localStorage.getItem("token")==null){
            window.history.replaceState(null, "", '/login.html');
            location.reload()
        }
    </script>
</head>

<body>
    <div class="page-container">
        <div class="side-menu"></div>
        <div class="main-container">
            <div class="header-content">
                <i class="aidicon aidicon-backburger"></i>
                <span class="title-text"></span>
                <div class="user-info pull-right">
                    <img src="/images/backstageManage/img_01.png">
                    <span class="username"></span>
                </div>
            </div>
            <div class="main-content">
                <div class="main-wrapper">
                    <div class="standard-table-btn-con">
                        <button type="button" class="btn btn-primary m-right" id="add">新增</button>
                        <button type="button" class="btn btn-default m-right" id="delete_all"
                            disabled="disabled">批量删除</button>

                        <div class="right-operate-con">
                            <select id="relatePro" data-placeholder="所属项目">
                                <option></option>
                            </select>
                            <div class="searchbox m-right">
                                <span class="aidicon aidicon-magnify"></span>
                                <input id="search_val" placeholder="请输入搜索内容" />
                                <span class="aidicon aidicon-close"></span>
                            </div>
                        </div>
                    </div>
                    <div class="standard-table-body-con">
                        <table id="standard_table" class="display" cellspacing="0" width="100%"
                            style="table-layout: fixed;">

                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script id="addFormTpl" type="text/html">
        <div class="form-default">
            <form class="form-validate-dom addForm">
                {{if data.id}}
                <input type="hidden" id="id" value="{{data.id}}"/>
                {{/if}}
                <label for="name"><i>*</i>设备名称</label>
                <div class="form-group">
                    <input type="text" class="form-control" id="name" name="name" placeholder="请输入" required autocomplete="off" value="{{data.name}}">
                </div>  
                <label for="manager"><i>*</i>管理人</label>
                <div class="form-group">
                    <input type="text" class="form-control" id="manager" name="manager" placeholder="请输入" required autocomplete="off" value="{{data.manager}}">
                </div>  
                <label for="equipmentTypeId"><i>*</i>设备类型</label>
                <div class="form-group">
                    <select id="equipmentTypeId" class="form-control" data-placeholder="请选择" name="equipmentTypeId" required></select>
                </div>  
                <label for="maintainInfoId"><i>*</i>保养信息类别</label>
                <div class="form-group">
                    <select id="maintainInfoId" class="form-control" data-placeholder="请选择" name="maintainInfoId" required></select>
                </div>  
                <label for="sysClassId"><i>*</i>系统类别</label>
                <div class="form-group">
                    <select id="sysClassId" class="form-control" data-placeholder="请选择" name="sysClassId" required></select>
                </div>
                <label for="openTime"><i>*</i>启用时间</label>
                <div class="form-group">
                    <input type="text" class="form-control from-date" id="openTime" name="openTime" placeholder="请选择时间" required autocomplete="off" value="{{data.openTime}}">
                    <span class="aidicon aidicon-calendar dateicon icon1"></span>
                </div>  
                <label for="modelNum">设备型号</label>
                <div class="form-group">
                    <input type="text" class="form-control" id="modelNum" name="modelNum" placeholder="请输入" autocomplete="off" value="{{data.modelNum}}">
                </div>   
                <label for="lastMaintainTime">上次保养时间</label>
                <div class="form-group">
                    <input type="text" class="form-control from-date" id="lastMaintainTime" name="lastMaintainTime" placeholder="请选择时间" autocomplete="off" value="{{data.lastMaintainTime}}">
                    <span class="aidicon aidicon-calendar dateicon icon1"></span>
                </div>
                <label for="lastMaintainTime">上次保养时间</label>
                <div class="form-group">
                    <input type="text" class="form-control from-date" id="lastMaintainTime" name="lastMaintainTime" placeholder="请选择时间" autocomplete="off" value="{{data.lastMaintainTime}}">
                    <span class="aidicon aidicon-calendar dateicon icon1"></span>
                </div>
                <label for="maintainOperation">保养操作</label>
                <div class="form-group">
                    <textarea class="form-control" rows="3" id="maintainOperation" name="maintainOperation" placeholder="请输入内容">{{data.maintainOperation}}</textarea>  
                </div>     
                {{if data.id}}
                <label for="startDeviceId">运行点位关联</label>
                <div class="form-group">
                    <select id="startDeviceId" class="form-control" data-placeholder="请选择" name="startDeviceId" required></select>
                </div>  
                <label for="warnDeviceId">故障点位关联</label>
                <div class="form-group">
                    <select id="warnDeviceId" class="form-control" data-placeholder="请选择" name="warnDeviceId" required></select>
                </div>  
                {{/if}}
                <!-- <label for="status"><i>*</i>启用状态</label>
                <div class="form-group">
                    <span class="btn-switch btn-multiple-state">
                        <span value="1" class="btn-state status {{if data.status=='1'}}checked{{/if}}">启用</span>
                        <span value="0" class="btn-state status {{if data.status=='0'}}checked{{/if}}" >停用</span>
                    </span>
                </div>   -->
                <label for="prjMin">上传设备图片</label>
                <div id="progressDemo1" class="clearfix">
                    <ul class="photoUpload-ul">
                        {{if data.image}}
                        <li class="photoUpload-li" data-id="{{ data.image }}">
                            <div class="photoUpload-li-img-wrapper">
                                <img class="photoUpload-li-img" src="{{data.image}}">
                            </div>
                            <div class="photoUpload-loading-wrap"></div>
                            <i class="aidicon aidicon-close-circle photoUpload-delete"></i>
                        </li>
                        {{/if}}
                        <li id="photoUploadMulti1" class="photoUpload" {{if data.image}}style="display:none;"{{/if}}>
                            <i id="chose_file1" class="aidicon aidicon-plus"></i>
                            <div class="photoUpload-info">上传</div>
                        </li>
                    </ul>
                </div>
            

            </form> 
        </div>
    </script>

    <script id="relationTpl" type="text/html">
        <div class="input-group input-group-icon" data-clear="true">
            <i class="aidicon aidicon-magnify" id="search-classify"></i>
            <input type="text" class="form-control" id="classifyInput" placeholder="请输入设备参数名称">
        </div>
        {{if $data&&$data.length>0}}
        {{each $data as val i}}
        <div class="checkbox">
            <label class="checkbox-beauty">
                <input deviceId="{{val.id}}" class="device-checked" type="checkbox" {{if val.checked}}checked{{/if}}>
                <span class="text-label">{{val.text}}</span>
            </label>
        </div>
        {{/each}}
        {{/if}}
    </script>
    <script src="/common/js/lib/require/require.min.js"></script>
    <script>
        require(["/js/require.config.js"], function () {
            require(["/js/backstageManage/menu.js"], function () {
                require(["/js/backstageManage/equipmentInfo.js"], function (app) {
                    app.init();
                });
            });
        });
    </script>
</body>

</html>